package cn.epsilon3.configBean;

import cn.epsilon3.annotation.E3Config;
import cn.epsilon3.constant.ClassTypeEnum;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @description 黑名单配置注入
 *
 * @author: epsilon3
 * @date: 2023/9/5 23:12
 */
@Data
@Component
@ConfigurationProperties(
        prefix = "epsilon3.config.security.black"
)
public class InitializingSecurityBlackListConfig {

    /**
     * 黑名单加载开关
     */
    @E3Config(suffixName = "enable",
    defaultValue = "false",
    type = ClassTypeEnum.BOOLEAN,
    comment = "是否开启黑名单校验")
    private Boolean enable;

    @E3Config(suffixName = "count",
            defaultValue = "60",
            type = ClassTypeEnum.INTEGER,
            comment = "单位时间内请求次数")
    private Integer count;

    @E3Config(suffixName = "cycleTime",
            defaultValue = "60",
            type = ClassTypeEnum.LONG,
            comment = "单位时间（秒）")
    private Long cycleTime;

    private List<String> defaultIp;
}
